#include "addcontactitem.h"
#include "ui_addcontactitem.h"

void AddContactItem::SetInfo(int type, QString name, QString text)
{
    if( type == 0 )
        ui->add_contact_btn->setText("添加");
    else
        ui->add_contact_btn->setText("加入");
    QPixmap pixmap(":/images/head_2.jpg");
    ui->icon->setPixmap(pixmap.scaled(ui->icon->size(), Qt::KeepAspectRatio,
                                      Qt::SmoothTransformation));
    ui->icon->setScaledContents(true);
    ui->name->setText(name);
    ui->text->setText(text);

}

AddContactItem::AddContactItem(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::AddContactItem)
{
    ui->setupUi(this);
}

AddContactItem::~AddContactItem()
{
    delete ui;
}
